home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #include <midi.h>
- #include <midiio.h>
- #include <malloc.h>
- #include <stdio.h>
- #include <unistd.h>
- #include <string.h>
-
- // Turn your Indigo into the worlds most expensive MIDI thru box!
-
- #define BUFSZ 1
-
- main(int argc, char **argv)
- {
- MIport port;
- MIevent e[BUFSZ];
- MIconfig c;
- u_int pbuf[2];
- int relative = 0;
- int i = 0;
-
- if (argc > 1 && strcmp(argv[1],"-r") == 0) {
- relative = 1;
- pbuf[0] = MI_STAMPING;
- pbuf[1] = MIRELSTAMP;
- c.setparams(pbuf,2);
- }
-
-
- if (port.open("rt", &c) < 0) {
- exit(-1);
- }
-
- if (relative)
- port.setstart((struct timeval *) 0);
-
- while (1) {
- int retval;
-
- if ((retval = port.receive(e, BUFSZ)) < 0) // receive 1 event
- {
- exit(-1);
- }
-
- if (retval > 0)
- retval = port.send(e, retval);
-
- if (retval < 0) {
- exit(-1);
- }
- }
- }
-